package com.opages.cloud.demo.controller;

import com.opages.cloud.demo.api.CloudDemoApi;
import com.opages.cloud.demo.model.CloudDemoDto;
import com.opages.cloud.example.api.CloudExampleApi;
import com.opages.cloud.example.model.CloudExampleDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author daizhong.liu
 * @create 2020-06-07 21:22
 **/
@RestController
public class CloudDemoController implements CloudDemoApi {
    @Autowired
    private CloudExampleApi cloudExampleApi;
    @Override
    public CloudDemoDto getDemo(Integer id) {
        List<CloudExampleDto> examples = cloudExampleApi.examples("hello" + id);
        System.err.println(examples.toString());
        CloudDemoDto cd = new CloudDemoDto();
        cd.setAge(1);
        cd.setName("demo");
        cd.setId(id);
        return cd;
    }
}
